package com.kpijavatraining.module2.question;

public class QuestionStringAnswer extends Question {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5827982478827848110L;
	/**
	 * 
	 */
	private final String CorrectAnswer;
	
	public QuestionStringAnswer(String question, String CorrectAnswer) {
		super(question);
		this.CorrectAnswer = CorrectAnswer;
	}

	@Override
	public void answer(String answer){
		if( answer.equals(getCorrectAnswer())){
			setScore(1);
		}
	}

	@Override
	public String toString(){
		return super.toString();	
	}
	
	private String getCorrectAnswer() {
		return CorrectAnswer;
	}
}
